package psd.model.Prolog.Converters;

import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;

import psd.model.IConverter;
import psd.model.Prolog.FactGenerationToolbox;
import psd.model.Prolog.PrologConverter;


public class PrologAnnotationTypeDeclarationConverter extends PrologConverter
		implements IConverter<AnnotationTypeDeclaration> {

	public PrologAnnotationTypeDeclarationConverter(
			FactGenerationToolbox toolbox) {
		super(toolbox);
	}

	@Override
	public boolean convert(AnnotationTypeDeclaration node) {
		visitAbstractTypeDeclaration(node, null, null);
		String superClass = idResolver.getJavaLangAnnotationAnnotationID();
		String id = idResolver.getID(node);
		checkAndGenComments(node, id);
		writer.writeFact("extendsT", new String[] { id, superClass, this.getFilePath(node), this.getLineNumber(node) });
		checkAndGenComments(node, id);
		writer.writeFact("annotationTypeT", new String[] { id, this.getFilePath(node), this.getLineNumber(node) });
		return true;
	}

}
